package com.wteam.dragon.shop.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * @Author 陈晓辉
 * @Date 2020/7/7 16:52
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class Product extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "对应的商品分类id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long productSortId;

    @IsNotNull
    @Column(comment = "对应的商品分类名称")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String productSortName;

    @IsNotNull
    @Column(comment = "商品名称")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String name;

    @Column(comment = "商品副标题")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String subhead;

    @Column(comment = "商品介绍")
    @ColumnType(MySqlTypeConstant.TEXT)
    private String introduce;

    @Column(comment = "货号")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String productSn;

    @IsNotNull
    @Column(comment = "售价")
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 12, decimalLength = 2)
    private BigDecimal price;

    @IsNotNull
    @Column(comment = "市场价")
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 12, decimalLength = 2)
    private BigDecimal originalPrice;

    @IsNotNull
    @Column(comment = "商品库存")
    @ColumnType(MySqlTypeConstant.INT)
    @DefaultValue("0")
    private Integer stock;

    @Column(comment = "单位")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String unit;

    @Column(comment = "重量(默认为克)")
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 12, decimalLength = 2)
    private BigDecimal weight;

    @IsNotNull
    @Column(comment = "排序")
    @ColumnType(MySqlTypeConstant.BIGINT)
    @DefaultValue("1")
    private Long sort;

    @Column(comment = "商品相册（限制5张）")
    @ColumnType(MySqlTypeConstant.TEXT)
    private String album;

    @Column(comment = "商品详情")
    @ColumnType(MySqlTypeConstant.TEXT)
    private String detail;

    @IsNotNull
    @Column(comment = "上架状态 (0 下架 1 上架)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer publishStatus;

    @IsNotNull
    @Column(comment = "是否新品 (0 不是新品 1 是新品)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer newStatus;

    @IsNotNull
    @Column(comment = "是否推荐 (0 不推荐 1 推荐)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer recommendStatus;

    @Column(comment = "对应的品牌id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long brandId;

    @Column(comment = "品牌名(中文名)")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String brandName;

    @Column(comment = "品牌名(英文名)")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String brandNameEn;

    @Column(comment = "关键字")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String keywords;
}
